<template>
  <div class="evaluate-upload">
    <div class="image" v-for="img in images" @click="currImage=img" :key="img.index">
      <img :src="img" alt="" />
    </div>
  </div>
  <div class="preview" v-if="currImage">
    <img :src="currImage" alt="">
    <i @click="currImage=null" class="iconfont icon-guanbi"></i>
  </div>
</template>

<script>
import { ref } from 'vue'
export default {
  name: 'EvaluateDetailImg',
  props: {
    images: {
      type: Array,
      default: () => []
    }
  },
  setup () {
    const currImage = ref(null)
    return { currImage }
  }
}
</script>

<style lang="less" scoped>
.evaluate-upload {
  display: flex;
  flex-wrap: wrap;
  .image {
    width: 80px;
    height: 80px;
    margin-right: 12px;
    margin-bottom: 12px;
    position: relative;
    img {
      width: 100%;
      height: 100%;
    }
  }
}
.preview {
    width: 680px;
    height: 600px;
    border: 1px solid #e4e4e4;
    background: #000000;
    margin-bottom: 20px;
    position: relative;
    img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}
</style>
